package com.gugee.ins.common.dal.service.dic.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gugee.ins.common.dal.mapper.dic.InsDicCategoryMapper;
import com.gugee.ins.common.dal.service.dic.InsDicCategoryDao;
import com.gugee.ins.common.model.mysql.dic.InsDicCategory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class InsDicCategoryDaoImpl extends ServiceImpl<InsDicCategoryMapper, InsDicCategory> implements InsDicCategoryDao {
    @Override
    public List<InsDicCategory> getDistinctAll() {
        return baseMapper.findDistinctAll();
    }

    /**
     * 获取所有一级分类
     * @return
     */
    @Override
    public List<String> findAllOverallCategory(){
        return baseMapper.findAllOverallCategory();
    }

    /**
     * 根据二级分类获取一级分类
     * @param category
     * @return
     */
    @Override
    public String findOverallCategoryByCategory(String category) {
        return baseMapper.findOverallCategoryByCategory(category);
    }
}
